﻿@page "/line/stack"
<Echarts Option="@option"></Echarts>

<div class="card">
    <div class="card-header">
        查看源代码
    </div>
    <div class="card-body">
        <pre>
            <code>
                private object option;

                protected override void OnInitialized()
                {

                option = new
                {
                Title = new
                {
                Text = "堆叠区域图"
                },
                Tooltip =
                new
                {
                trigger = "axis",
                AxisPointer =
                new
                {
                Type = "cross",
                label = new
                {
                backgroundColor = "#6a7985"
                }
                }
                },
                Legend = new
                {
                Data = new string[] { "邮件营销", "联盟广告", "视频广告", "直接访问", "搜索引擎" }
                },
                Toolbox = new
                {
                Feature = new
                {
                SaveAsImage = new { }
                }
                },
                Grid = new
                {
                Left = "3%",
                Right = "4%",
                Bottom = "3%",
                ContainLabel = true
                },
                XAxis = new object[]
                {
                new {
                Type = "category",
                BoundaryGap = false,
                Data =new string[]{"周一", "周二", "周三", "周四", "周五", "周六", "周日" }
                }
                },
                YAxis = new object[]
                {
                new  {
                Type = "value"
                }
                },
                Series = new object[]
                {
                new {
                Name = "邮件营销",
                Type = "line",
                Stack = "总量",
                AreaStyle =new { },
                Data =new double[]{120, 132, 101, 134, 90, 230, 210 }
                },new {
                Name = "联盟广告",
                Type = "line",
                Stack = "总量",
                AreaStyle =new { },
                Data =new double[]{220, 182, 191, 234, 290, 330, 310 }

                },
                new {

                Name = "视频广告",
                Type = "line",
                Stack = "总量",
                AreaStyle =new { },
                Data =new double[]{150, 232, 201, 154, 190, 330, 410 }
                },
                new{
                name = "直接访问",
                Type = "line",
                Stack = "总量",
                AreaStyle =new { },
                Data =new double[]{320, 332, 301, 334, 390, 330, 320 }
                },
                new
                {
                Name = "搜索引擎",
                Type = "line",
                Stack = "总量",
                Label = new
                {
                Normal =new
                {
                Show = true,
                Position = "top"
                }
                },
                areaStyle =new { },
                Data =new double[]{820, 932, 901, 934, 1290, 1330, 1320 }
                }
                }

                };

                }
            </code>
</pre>
    </div>
</div>

@code{

    private object option;

    protected override void OnInitialized()
    {

        option = new
        {
            Title = new
            {
                Text = "堆叠区域图"
            },
            Tooltip =
                new
                {
                    trigger = "axis",
                    AxisPointer =
            new
            {
                Type = "cross",
                label = new
                {
                    backgroundColor = "#6a7985"
                }
            }
                },
            Legend = new
            {
                Data = new string[] { "邮件营销", "联盟广告", "视频广告", "直接访问", "搜索引擎" }
            },
            Toolbox = new
            {
                Feature = new
                {
                    SaveAsImage = new { }
                }
            },
            Grid = new
            {
                Left = "3%",
                Right = "4%",
                Bottom = "3%",
                ContainLabel = true
            },
            XAxis = new object[]
            {
                new {
            Type = "category",
            BoundaryGap = false,
            Data =new string[]{"周一", "周二", "周三", "周四", "周五", "周六", "周日" }
                    }
                        },
            YAxis = new object[]
            {
                new  {
            Type = "value"
                }
                        },
            Series = new object[]
            {
            new {
            Name = "邮件营销",
            Type = "line",
            Stack = "总量",
            AreaStyle =new { },
            Data =new double[]{120, 132, 101, 134, 90, 230, 210 }
            },new {
                Name = "联盟广告",
                Type = "line",
                Stack = "总量",
                AreaStyle =new { },
                Data =new double[]{220, 182, 191, 234, 290, 330, 310 }

                },
                new {

                    Name = "视频广告",
            Type = "line",
            Stack = "总量",
            AreaStyle =new { },
            Data =new double[]{150, 232, 201, 154, 190, 330, 410 }
        },
new{
                    name = "直接访问",
Type = "line",
Stack = "总量",
AreaStyle =new { },
Data =new double[]{320, 332, 301, 334, 390, 330, 320 }
},
new
{
                    Name = "搜索引擎",
Type = "line",
Stack = "总量",
Label = new
{
                        Normal =new
    {
                            Show = true,
    Position = "top"
    }
                    },
areaStyle =new { },
Data =new double[]{820, 932, 901, 934, 1290, 1330, 1320 }
}
                                                            }

        };

    }

}